<?php
class WDealBarcode extends UWidgetWorklet
{
	public $barcode;
	
	public function taskConfig()
	{
		wm()->get('base.init')->setRenderType('ajax-no-scripts');
		$this->barcode = isset($_GET['barcode'])?$_GET['barcode']:null;
		if(!$this->barcode)
			return $this->show = false;
	}
	
	public function taskRenderOutput()
	{
		Yii::import('application.modules.deal.extensions.barcode.CBarcode');
		
		//list($barcodeCode,$barcodeType) = explode(':',$this->barcode);
		CBarcode::getInstance($this->barcode, 'Code39', 'gif');
		app()->end();
	}
}